<template>
  <FormItem :label="config.name">
    <component :is="componentName"
               v-bind="config.config"></component>
  </FormItem>
</template>

<script>
  export default {
    name: "CustomFormItem",
    data() {
      return {
        componentList: {
          input: 'Input',
          select: 'Select'
        }
      }
    },
    computed: {
      componentName() {
        return this.componentList[this.config.component]
      }
    },
    props: {
      config: {
        require: true,
        type: Object
      }
    }
  }
</script>

<style scoped>

</style>